package org.peterbjornx.gamestate;

import org.peterbjornx.Client;

import java.awt.event.MouseListener;
import java.awt.event.KeyListener;
import java.awt.*;


/**
 * Created by IntelliJ IDEA.
 * User: PeterbjornX
 * Date: Apr 8, 2009
 * Time: 8:37:28 PM
 * Defines a gamestate handler
 */
public abstract class GameState implements KeyListener, MouseListener {
    Client myClient;
    public boolean needvp_change = false;
    public int vp_x;
    public int vp_y;
    public int vp_w;
    public int vp_h;
    public boolean opengl_enabled = false;

    public GameState(Client clientinstance){
        myClient = clientinstance; 
    }

    public abstract void addMessage(String s);

    public void paint(Graphics g){
        myClient.drawtitleback(g);
        String text = "GameState has not overridden paint(Graphics)";
        int x = 7;
        int y = 27;
        int sw = (int) g.getFontMetrics().getStringBounds(text,g).getWidth() + 6;
        g.setColor(Color.black);
        g.fillRect(x,y,sw,g.getFontMetrics().getHeight()+5);
        g.setColor(Color.white);
        g.drawRect(x,y,sw,g.getFontMetrics().getHeight()+5);
        g.drawString(text,x+3,(g.getFontMetrics().getHeight())+y);
    }

    public abstract void notifyloaded();
}
